{extend name="common:base" /}
{block name="content"}
<div class="row">
<form class="form-horizontal" action="{:url('index',['act'=>'update'])}" method="post">

<div class="tabbable">
    <ul class="nav nav-tabs" id="myTab">
        <li class="active">
            <a data-toggle="tab" href="#base">
                <i class="green ace-icon fa fa-cog bigger-120"></i>
                基本设置
            </a>
        </li>
        <li>
            <a data-toggle="tab" href="#database">
                <i class="green ace-icon fa fa-floppy-o bigger-120"></i>
                数据备份
            </a>
        </li>
        <li>

            <a data-toggle="tab" href="#custom">
                <i class="green ace-icon fa fa-info-circle bigger-120"></i>
                自定义设置
            </a>
        </li>
    </ul>

    <div class="tab-content">
        <div id="base" class="tab-pane fade in active">
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="title"> 标题 </label>
                <div class="col-sm-9">
                            <input type="text" name="title" id="title" class="col-xs-10 col-sm-5" value="{$cyConfig.title}">
                            <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle"></span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="sitename"> 简称 </label>
                <div class="col-sm-9">
                            <input type="text" name="sitename" id="sitename" class="col-xs-10 col-sm-5" value="{$cyConfig.sitename}">
                            <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle"></span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="keywords"> 关键词 </label>
                <div class="col-sm-9">
                            <input type="text" name="keywords" id="keywords" class="col-xs-10 col-sm-5" value="{$cyConfig.keywords}">
                            <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle"></span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="description"> 描述 </label>
                <div class="col-sm-9">
                        <textarea name="description" id="description" placeholder="描述" class="col-xs-10 col-sm-5" rows="5">{$cyConfig.description}</textarea>
                        <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle"></span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="footer"> 底部 </label>
                <div class="col-sm-9">
                        <textarea name="footer" id="footer" placeholder="描述" class="col-xs-10 col-sm-5" rows="5">{$cyConfig.footer}</textarea>
                        <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle"></span>
                    </span>
                </div>
            </div>
        </div>
        <div id="database" class="tab-pane fade in">
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="db_path"> 备份目录 </label>
                <div class="col-sm-9">
                            <input type="text" name="db_path" id="db_path" class="col-xs-10 col-sm-5" value="{$cyConfig.db_path}">
                            <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle">数据库备份目录，相对于系统根目录开始</span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="db_part"> 分卷长度 </label>
                <div class="col-sm-9">
                            <input type="text" name="db_part" id="db_part" class="col-xs-10 col-sm-5" value="{$cyConfig.db_part}">
                            <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle">该值用于限制压缩后的分卷最大长度。单位：B；建议设置20M</span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="db_compress"> 压缩备份 </label>
                <div class="col-sm-9">
                    <select id="db_compress" name="db_compress" class="col-xs-10 col-sm-5">
                        <option {if $cyConfig.db_compress ==0}selected="selected"{/if} value="0">禁用</option>
                        <option {if $cyConfig.db_compress ==1}selected="selected"{/if} value="1">启用</option>
                    </select>
                    <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle">压缩备份文件需要PHP环境支持gzopen，gzwrite函数。</span>
                    </span>
                </div>
            </div>
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="db_level"> 压缩级别 </label>
                <div class="col-sm-9">
                            <select id="db_level" name="db_level" class="col-xs-10 col-sm-5">
                                <option {if $cyConfig.db_level ==1}selected="selected"{/if} value="1">普通</option>
                                <option {if $cyConfig.db_level ==4}selected="selected"{/if} value="4">一般</option>
                                <option {if $cyConfig.db_level ==9}selected="selected"{/if} value="9">最高</option>
                            </select>
                            <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle"></span>
                    </span>
                </div>
            </div>
        </div>
        <div id="custom" class="tab-pane fade in">
            {volist name="cyConfig.custom" id="val" empty="无自定义设置"}
            <div class="space-4"></div>
            <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right" for="{$val.var}"> {$val.name} </label>
                <div class="col-sm-9">
                    {egt name="val.value|strlen" value="100"}
                    <textarea name="custom[{$key}]{$val.var}" id="{$val.var}" placeholder="{$val.name}" class="col-xs-10 col-sm-5" rows="5">{$val.value|htmlspecialchars|raw}
                    </textarea>
                    {/egt}
                    {lt name="val.value|strlen" value="100"}
                    <input name="custom[{$key}][name]" value="{$val.name}" type="hidden" />
                    <input name="custom[{$key}][var]" value="{$val.var}" type="hidden" />
                    <input type="text" name="custom[{$key}][value]" id="{$val.value}" class="col-xs-10 col-sm-5" value="{$val.value|htmlspecialchars|raw}">
                    <input name="custom[{$key}][tips]" value="{$val.tips}" type="hidden" />
                    {/lt}
                    <span class="help-inline col-xs-12 col-sm-7">
                        <span class="middle">{$val.tips}</span>
                    </span>
                </div>
            </div>
            {/volist}
        </div>
    </div>
</div>

<div class="space-4"></div>
<div class="col-md-offset-2 col-md-9">
    <button id="submit" class="btn btn-info" type="submit">
        <i class="icon-ok bigger-110"></i>
        提交
    </button>

    &nbsp; &nbsp; &nbsp;
    <button class="btn" type="reset">
        <i class="icon-undo bigger-110"></i>
        重置
    </button>
</div>
</form>
</div>
{/block}
